package com.itheima.Test;

import com.itheima.LockTest.ReadWriteLock;
import com.sun.org.apache.regexp.internal.RE;
import javafx.scene.input.InputMethodTextRun;
import org.springframework.stereotype.Component;

import java.util.*;
import java.util.concurrent.CountDownLatch;

/**
 * @PackageName: com.itheima.Test
 * @ClassName: ReadWriteLockTest
 * @Author: Renyz
 * @Date: 2021/11/12 12:16
 * @Description: //TODO
 */


public class ReadWriteLockTest {

    public static void main(String[] args) {

        CountDownLatch countDownLatch = new CountDownLatch(100);
        for (int i = 0; i < 100; i++) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    ReadWriteLock.getWrite(UUID.randomUUID().toString().substring(0,3), "value");
                    ReadWriteLock.getRead();
                }
            },"T"+i).start();
        }

    }
}
